/**
 * @file   Property.h
 * @author Djuro Drljaca (djurodrljaca@gmail.com)
 * @date   2013-05-16
 * @brief  DataBus Property.
 *
 * Copyright (C) 2013  Djuro Drljaca <djurodrljaca@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef LIBDATABUS_COMMON_PROPERTY_H
#define LIBDATABUS_COMMON_PROPERTY_H

#include <DataBus/Common/Common.h>
#include <DataBus/Common/PropertyInfo.h>
#include <DataBus/Common/Value.h>

namespace DataBus
{
/**
 * @brief The PropertyInfo class
 */
class DATABUSSHARED_EXPORT Property
{
public:
    /**
     * @brief Constructor for Property
     */
    Property();

    /**
     * @brief Constructor for Property
     *
     * @param propertyInfo  Property Info
     * @param defaultValue  Property default Value
     */
    Property(const PropertyInfo &propertyInfo,
             const Value &defaultValue);

    /**
     * @brief Get Property Info
     *
     * @return Property Info
     */
    PropertyInfo getPropertyInfo() const;

    /**
     * @brief Set Property Info
     *
     * @param propertyInfo  Property Info
     *
     * @retval true     Success
     * @retval false    Error
     */
    bool setPropertyInfo(const PropertyInfo &propertyInfo);

    /**
     * @brief Get Property Data Type
     *
     * @return Data Type
     */
    Value getValue() const;

    /**
     * @brief Set Property Value
     *
     * @param value Property Value
     *
     * @retval true     Success
     * @retval false    Error
     */
    bool setValue(const Value &value);

private:
    /**
     * @brief Property Info
     */
    PropertyInfo m_propertyInfo;

    /**
     * @brief Property Value
     */
    Value m_value;
};
}

#endif // LIBDATABUS_COMMON_PROPERTY_H
